package com.neu.util;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.util.Log;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

public  class MyLifteCycle implements LifecycleObserver {
    Intent intent;
    public MyLifteCycle(Intent intent){
        this.intent=intent;
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    public void onCreated(){

        Bundle bundle=intent.getExtras();
        if(bundle!=null){
            Log.d("TAG", "onCreate: "+bundle.getString("a"));
        }

    }

    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    public void onStart(){
        Log.d("TAG", "onStart: Activity onStart方法调用了");
    }


}
